<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<link rel="stylesheet" type="text/css" href="../../../Themes/default/easyui.css">
		<link rel="stylesheet" type="text/css" href="../../../CSS/demo.css">
		<link rel="stylesheet" type="text/css" href="../../../Themes/icon.css">
		<link rel="stylesheet" type="text/css" href="../../../CSS/common.css">
		<script type="text/javascript" src="../../../JS/jquery.min.js"></script>
		<script type="text/javascript" src="../../../JS/jquery.easyui.min.js"></script>
		<script type="text/javascript" src="../../../JS/common.js"></script>
		<script type="text/javascript" src='../../../JS/SHA-1.js'></script>
	</head>

	<body style="padding: 0px;">
		<div class="easyui-layout" style="width:100%;height:600px;">
			<div data-options="region:'center'">
				<div>
					<table id="dg" style="width: 100%;" class="table_style">
					</table>
				</div>
			</div>
		</div>
		<div id="toolbar"></div>
		<div id="dlg" class="hiddenDialog">
			<iframe id="ifrmEdit" style="width: 100%;height: 100%;" frameborder="0" scrolling="no"></iframe>
		</div>
	</body>
	<script>
	    var _localData=localStorage.getItem("WebSearchData");
	    if(_localData!=null)
	    {
	    	var WebData = JSON.parse(_localData);
	    }
		
		$('#dg').datagrid({
			data: WebData.slice(0,10),
			toolbar: '#toolbar',
			method: 'get',
			pagination: 'true',
			rownumbers: 'true',
			autoRowHeight: 'true',
			fitColumns: 'false',
			height: 350,
			/*表格中的列名以及各自列名的ID*/
			columns: [
				[{
					field: 'ID',
					title: 'ID',
					width: '0%',
					align: 'center'
				}, {
					field: 'CUSTOMER_TYPE',
					title: '用户组',
					width: '19%',
					align: 'center'
				}, {
					field: 'CUSTOMER_NAME',
					title: '配送单位名称',
					width: '19%',
					align: 'center'
				}, {
					field: 'DISTRIBUTION_DATE',
					title: '配送开始时间',
					width: '29%',
					align: 'center'
				}, 
				{
					field: 'LUMP_SUM',
					title: '总价',
					width: '28%',
					align: 'center',
					formatter: function(value, row, index) {
						if(value) {
							return "￥" + value + "元";
						}
					}
				}]
			],
			onDblClickRow: function(index, row) {
				var pLocation = "";
				pLocation = "UI/LOGISTICS/WebOrder/WebOrderAdd.html?id=" + row.ID+"&city="+row.city; /*将BoothManagementAdd.html的相对路径与被选中行的ID赋值给pLocation*/
				AddTabIn("订单详情", parent.parent.$("#tabs"), pLocation);
			}
		});
		$("#dg").datagrid("hideColumn","ID");
		//分页
		var pager = $("#dg").datagrid("getPager"); 
	    pager.pagination({ 
	        total:WebData.length, 
	        onSelectPage:function (pageNo, pageSize){ 
	          var start = (pageNo - 1) * pageSize; 
	          var end = start + pageSize; 
	          $("#dg").datagrid("loadData", WebData.slice(start, end)); 
	          pager.pagination('refresh', { 
		          total:WebData.length, 
		          pageNumber:pageNo 
	          }); 
	        } 
	    }); 
	</script>

</html>